//import proFetch from 'src/hrpub/common/utils/project-fetch';
import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
export default {
	name: 'emp',
	data: {
		orgValue: { refpk: '' }, // 人力资源组织
		language: {}, // 多语
		context: {}, // 上下文
		oid: '', //模板id
		widget:false,
		widgetValue:'widget',
		workflow_state: null, // 目前只有 待入职='7',拒绝入职='8',已入职='102' 三种状态
		pageInfo: {
			pageIndex: 1,
			pageSize: 10,
			total: 0,
			totalPage: 1
		}, // 主页面表格的分页信息
		page: 'main', // 当前页面， main主页面，add新增页面，edit修改页面
		offerContentModalVisible: false, // 发送offer弹窗的显示隐藏
		beginDate: '', // 计划入职时间
		beginDateOri: '', // 原计划入职时间
		ctrtClose: false, //合同表单开关状态
		ctrtDisp: 'block', // 合同表单默认显示
		addPageDisp: 'block', //单据页面默认显示
		qryEntryDisp: 'none', //联查入职单页面默认显示
		psnInfoDisp: 'none', // 员工登记表页面默认显示
		addBtnDisp: 'block', //单据页面按钮显示
		ctrtBtnDisp: 'inline-block', //员工合同信息关闭按钮显示
		ctrtOpenBtnDisp: 'none', //员工合同信息打开按钮显示
		handEntryModalVisible: false, //确认入职模态框默认显示
		reEntryModalVisible: false, //拒绝入职模态框默认显示
		showOrgRefer: false, // 是否显示组织参照
		checkboxDisp: 'inline-block', //入职材料列表是否接收多选框默认显示
		materialength: 0, //合同材料列表行数
		isUnentryEdit: true, //是否为未入职
		addPageStatus: 'browse',
		init: false, // 是否点击查询过 点过查询了 才去请求数据  否则查询区如果设置了必填项， 首次进入会抛出提示
		//checkboxDisabled: false
		//checkall: false
	},
	sync: {
		update(state, payload) {
			return {
				...state,
				...payload
			};
		}
	},
	async: {
		// 获取主页面表格数据
		getMainTableData(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryQueryHandleAction.do',
				body: payload.postData
			});
		},
		// 获取一条数据
		getOneBillData(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryQueryHandInfAction.do',
				body: payload.postData
			});
		},
		// 发送日期
		sendDate(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryModifyBegindateAction.do',
				body: payload.postData
			});
		},
		// 合同表单编辑后
		formEditAfter(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryHandleCtrtAfterEditAction.do',
				body: payload.postData
			});
		},
		// 保存&确认入职
		handEntry(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryHandleEntryAction.do',
				body: payload.postData
			});
		},
		// 拒绝入职
		rejectEntry(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryNoShowAction.do',
				body: payload.postData
			});
		},
		//联查入职单
		getEntryData(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryQueryOneAction.do',
				body: payload.postData
			});
		},
		//联查员工登记表
		getPsnInfoData(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryQueryEntryPsnInfoAction.do',
				body: payload.postData
			});
		},
		//无用
		// ganmaya(dispatch, getState, payload) {
		//     const state = getState();
		//     console.log('eeeee', state)
		//     return true;
		// },
		//发送缺件提醒
		sendMissRemind(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntrySendMissRemindAction.do',
				body: payload.postData
			});
		},
		//确认收件
		confirmRec(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryConfirmRecAllAction.do',
				body: payload.postData
			});
		},
		//确认入职校验
		handEntryCheck(dispatch, getState, payload) {
			return proFetch({
				url: '/nccloud/hrtrn/entrymng/EntryHandleEntryCheckAction.do',
				body: payload.postData
			});
		},
		//小部件跳转接口
        getWidgetTableData(dispatch,getState,payload){
            return proFetch({
                url: '/nccloud/hrtrn/widgets/ListData.do',
                body: payload.postData
            })
        },

		// 合同断码补码
		codeRollBack(dispatch,getState,payload) {
			return proFetch({
                url: '/nccloud/hrcm/common/CodeRollBackAction.do',
                body: payload.postData
            })
		}
	}
};
